import React, { useState } from 'react'
/* 
  1 为props定义类型
  2 为 useState定义类型
*/
/* interface PropType {
  title: string
} */
type PropType = {
  title: string
}
export default function index(props: PropType) {
  const [num, setNum] = useState<number>(10);
  return (
    <div>
      <h3>navbar组件</h3>
      <button onClick = {
        () => {
          setNum([1,2,3,4])
        }
      }>按钮</button>
      { num }
      {props.title}
    </div>
  )
}
